<?php
/**
 * Created by PhpStorm.
 * User: Simpson
 * Date: 2016/9/8
 * Time: 13:20
 */

namespace App\Service;

use App\Model\Feedback;
use Illuminate\Http\Request;

class OperationService
{
    /**
     * 创建维护反馈，插入数据库
     * @param Request $request
     * @return bool
     */
    public function createFeedback(Request $request)
    {
        $user = \Auth::guard('wechat')->user();

        $feedback = Feedback::create([
            'open_id' => $user->open_id,
            'content' => $request->input('content'),
            'source' => RepairService::REPAIR_SOURCE,
        ]);

        return $feedback ? true : false;

    }
}